<template>
  <view>
    <view class="" v-if="token">
      用户： XXXXXXXXXXXXX
    </view>
    <view class="" v-else>
      未登录， 请登录
      <button @click="getUserInfo">登录</button>

    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        token: uni.getStorageSync('token') || ''
      };
    },
    methods: {
      getUserInfo() {
        uni.getUserInfo({
          success: resp => {
            console.log(resp)
          }
        })
      }
    }
  }
</script>

<style lang="scss">

</style>
